﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using FAS.App_Code;
using FAS.Objetos;
using FAS;
using System.IO;
using System.Net;

namespace FasGUI
{
    public partial class NuevoObjetivo : Form
    {
        private FormFiltroCatalogo filtro;
        public NuevoObjetivo(FormFiltroCatalogo form)
        {
            this.filtro = form;
            // TODO: Complete member initialization
            InitializeComponent();
        }

        private bool isAnswer(RadioButton radioButton)
        {
            return radioButton.Checked;
        }

        private void NuevoProblema_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Dispose();
            filtro.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Dispose();
            filtro.Show();
        }


        private void button1_Click_1(object sender, EventArgs e)
        {
            this.NuevoProblema_FormClosed(sender, null);
        }

        private void button1_Click_2(object sender, EventArgs e)
        {
            if (textBox1.Text != String.Empty && textBox2.Text != String.Empty)
            {
                Objetivo o = new Objetivo(textBox2.Text, null, filtro.materia, textBox1.Text);
                o.insertar();
                MessageBox.Show("Se Ha Creado el Objetivo");
                this.Dispose();
                filtro.fillAll();
            }
            else MessageBox.Show("Error: Faltan Datos");
        }
       
    }
}